{% extends "default/admin/include/innerBase.html" %}{% block mainer %}
<table id="columnList" class="elementList">
	<thead><tr fold="0">
    	<th width="60px"><div>顺序</div></th><th width="150px"><div>名称</div></th><th width="150px"><div>栏目值</div></th>
    	<th width="200px"><div>描述</div></th><th width="100px"><div>模型</div></th><th width="60px"><div>显示</div></th><th><div>操作</div></th>
    </tr></thead>
{% for e in columnList %}{% include site.theme|stringformat:"s/admin/include/element.html" with e=e etype='column' %}{% endfor %}
<tr id="addColumn" class="treetr"><td colspan="7"><span class="addtree"><a href="javascript:addColumn();">添加栏目</a></span></td></tr>
</table>
<div id="tb_column" style="display:none;"><form><table class="formTable">{{columnForm}}</table></form></div>
<script type="text/javascript">
<!-- 
function addColumn(){
	var api = $.dialog({
					id:'addDlg', title:'增加栏目',
					content: $('#tb_column').html(),
					max: false, min: false, lock: true,
					okVal: '增加',
				    ok: function(){
				    	var thisDlg = this;
				    	$.post('/admin/add!Column.do', $('form',thisDlg.DOM.content).serialize(), 
			    			function(data){
					    		if(data.flag){$.dialog.alert(data.msg, function(){thisDlg.close();thisDlg.reload();});}
			      				else{$.dialog.alert(data.msg);}
			      			},'json');
				    	return false;
				    },
				    cancel: true
				});
}
function editColumn(id){
	var url = 'url:/admin/detailColumn-'+id+'.html';
	var api = $.dialog({
		id:'editDlg', title:'编辑栏目',
		content: url,
		max: false, min: false, lock: true, width: '300px',
		okVal: '编辑',
	    ok: function(){
	    	var thisDlg = this;
	    	var forms = $('form', thisDlg.iwin.document.body).serialize()+"&_retType=json";
	    	$.post('/admin/edit!Column.do', forms, 
    			function(data){
      				if(data.flag){$.dialog.alert(data.msg, function(){thisDlg.close();thisDlg.reload();});}
      				else{$.dialog.alert(data.msg);}
      			},'json');
	    	return false;
	    },
	    cancel: true
	});
}
$(function(){listHover();});
//-->
</script>
{% endblock %}